﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="QuanLyNgayNghi.aspx.cs"
    Inherits="ChamCong.Admin.QuanLyNgayNghi" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <!--Calendar Script-->
    <link type="text/css" rel="stylesheet" href="../Scripts/JSCal/css/jscal.css" />
    <link type="text/css" rel="stylesheet" href="../Scripts/JSCal/css/border-radius.css" />
    <script type="text/javascript" src="../Scripts/JSCal/js/jscal2.js"></script>
    <script type="text/javascript" src="../Scripts/JSCal/js/lang/vn.js"></script>
    <!--End Calendar-->
    <style type="text/css">
        .style1
        {
            width: 350px;
            margin: 10px;
            float: left;
        }
        .style2
        {
            width: 450px;
            margin: 10px;
            float: left;
            padding-left: 20px;
        }
        .style3
        {
            width: 120px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <asp:UpdatePanel ID="UpdatePhongBan" runat="server">
        <ContentTemplate>
            <div class="style1">
                <table style="width: 100%;">
                    <tr>
                        <td class="style3">
                            Ngày Nghỉ :
                        </td>
                        <td>
                            <asp:TextBox ID="txtNgay" runat="server" Width="100%"></asp:TextBox>
                            <script type="text/javascript">
                                Cal = new Calendar({
                                    inputField: "txtNgay",
                                    dateFormat: "%d/%m/%Y",
                                    trigger: "txtNgay",
                                    bottomBar: false,
                                    onSelect: function () { this.hide(); }
                                });

                                Sys.WebForms.PageRequestManager.getInstance().add_endRequest(CallCalendar);
                                function CallCalendar(sender, args) {
                                    $(".button").button();
                                    Cal = new Calendar({
                                        inputField: "txtNgay",
                                        dateFormat: "%d/%m/%Y",
                                        trigger: "txtNgay",
                                        bottomBar: false,
                                        onSelect: function () { this.hide(); }
                                    });
                                }
                            </script>
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            Tên Ngày Nghỉ :
                        </td>
                        <td>
                            <asp:TextBox ID="txtTenNgayNghi" runat="server" Width="100%"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" align="center">
                            
                            <asp:Button class="button" ID="btnThem" runat="server" Text="Thêm" Width="70px" OnClick="btnThem_Click" />
                            <asp:Button class="button" ID="btnUpdate" runat="server" Text="Cập nhật" 
                                OnClick="btnUpdate_Click" Visible="False" />
                            <asp:Button class="button" ID="btnCancel" runat="server" Text="Hủy" Width="70px"
                                OnClick="btnCancel_Click" />
                            <br />
                            <div>
                                <sbc:sbcMsgBox ID="sbcMsgBox1" runat="server" UseJQuery="True" />
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="style2">
                <asp:ScriptManager ID="ScriptManager1" runat="server">
                </asp:ScriptManager>
                Chọn năm:
                <asp:DropDownList ID="ddlNam" runat="server" AutoPostBack="True" 
                    onselectedindexchanged="ddlNam_SelectedIndexChanged">
                </asp:DropDownList>
                <br />
                    <asp:GridView ID="dgvNgayNghi" runat="server" AutoGenerateColumns="False"
                        OnRowDataBound="dgvNgayNghi_rowdatabound" CellPadding="4" ForeColor="#333333"
                        GridLines="None" AllowPaging="True" 
                    onpageindexchanging="dgvNgayNghi_PageIndexChanging">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:BoundField DataField="Ngay" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Ngày"
                                SortExpression="Ngay" />
                            <asp:BoundField DataField="TenNgayNghi" HeaderText="Thông tin ngày nghỉ" SortExpression="TenNgayNghi" />
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:ImageButton ID="imgbtXem" ImageUrl="~/Scripts/Image/Xem.jpg" Width="18px" Height="18px"
                                        runat="server" OnClick="imgbtXem_Click" ToolTip="Xem" />
                                    <asp:ImageButton ID="imgbtSua" ImageUrl="~/Scripts/Image/Sua.jpg" Width="18px" Height="18px"
                                        runat="server" OnClick="imgbtSua_Click" ToolTip="Sửa" />
                                    <asp:ImageButton ID="imgbtXoa" ImageUrl="~/Scripts/Image/Xoa.jpg" Width="18px" Height="18px"
                                        runat="server" OnClick="imgbtXoa_Click" ToolTip="Xóa" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <EditRowStyle BackColor="#2461BF" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" CssClass="pager" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
                    </asp:GridView>
                <p>
                    <sbc:sbcMsgBox ID="sbcMsgBox2" runat="server" UseJQuery="True" /></p>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
